<?php echo form_open('cities/update'); ?>

  <?php foreach($result as $row) { ?>
	<p>ID: <input type="text" name="id" id="id" value="<?php echo $row->id; ?>"></p>
	<p>City Name: <input type="text" name="cityname" id="cityname" value="<?php echo $row->name; ?>"></p>
	<p><?php echo form_submit('update','Update'); ?></p>
   <?php } ?>
	<?php echo form_close(); ?>
	<?php echo validation_errors(); ?>